From: Florian Müllner Date: Mon, 18 May 2020 16:44:57 +0000 (+0200) Subject: calendar: Fix initial do-not-disturb state X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~382 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=32bc064d10eee834924f074a914c7b155f9c79d8;p=gnome-shell.git calendar: Fix initial do-not-disturb state The do-not-disturb button and the contained switch are tied together via a bidirectional property binding. However it still matters which objects are used as source and target, as that will determine the initial state: Right now the (unchecked) button is used as source, which means that do-not-disturb is turned off on startup. We want the state to be preserved, so swap source and target to let the switch (that is bound to the underlying GSetting) control the initial state. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2804 --- diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 1a25dde25..35308c359 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -1199,8 +1199,8 @@ class CalendarMessageList extends St.Widget { child: this._dndSwitch, label_actor: dndLabel, }); - this._dndButton.bind_property('checked', - this._dndSwitch, 'state', + this._dndSwitch.bind_property('state', + this._dndButton, 'checked', GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE); hbox.add_child(this._dndButton);